package com.wmlive.hhvideo.heihei.mainhome.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.wmlive.hhvideo.common.base.BaseFragment;
import com.wmlive.hhvideo.heihei.mainhome.fragment.ExplosionFragment;
import com.wmlive.hhvideo.heihei.mainhome.fragment.AttentionFragmentNew;
import com.wmlive.hhvideo.heihei.mainhome.fragment.RecommendFragmentNew;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by vhawk on 2017/5/19.
 * Modify by lsq
 */

public class MainFragmentPageAdapter extends FragmentPagerAdapter {
//    private String[] titles = new String[]{"关注", "推荐", "最新"};

    private List<BaseFragment> fragmentList = new ArrayList<>();

    public MainFragmentPageAdapter(FragmentManager fm) {
        super(fm);
        fragmentList.add(AttentionFragmentNew.newInstance());//new
//        fragmentList.add(RecommendFragmentNew.newInstance(RecommendFragmentNew.TYPE_FOLLOW));//new
        fragmentList.add(RecommendFragmentNew.newInstance(RecommendFragmentNew.TYPE_RECOMMEND));//new
        fragmentList.add(ExplosionFragment.newInstance());
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }


}
